<%@ page contentType="text/html;charset=UTF-8"%> 
<%@ page import="java.util.*" %>
<%@ page import="com.yfeng.user.model.*" %>
<%
	String pageHtml = (String)request.getAttribute("pageHtml");
	String name = (String)request.getAttribute("name");
	String userid = (String)request.getAttribute("userid");
	String currPage = (String)request.getAttribute("currPage");
	List permissionList=(List)request.getAttribute("permissionList");
	List pidList=(List)request.getAttribute("pidList");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档</title>
<link href="${pageContext.request.contextPath}/common/themes/App_Themes/default/Style.css" rel="stylesheet" type="text/css" />
 <script src="${pageContext.request.contextPath}/common/js/common.js" type="text/javascript"></script>
 <script type="text/javascript" src="${pageContext.request.contextPath }/common/js/jquery-1.4.2.min.js"></script>
 <script type="text/javascript">
 $(document).ready(function(){
	   $("#checkall").click( 
     	function(){ 
     		if(this.checked){ 
     			$("input[name='id']").each(function(){this.checked=true;}); 
     		}else{ 
     			$("input[name='id']").each(function(){this.checked=false;}); 
     		} 
     });

	$("#given").click(function(){
		$("#delForm").submit();
	});
 });
 </script>
</head>

<body class="layout_body">
<div id="layout_container">

<div id="layout_mainContent">
    <!-- begin #layout_mainContent -->
    <!-- begin #box_table专用于grid -->
    <table   border="0" cellspacing="0" cellpadding="0" class="box_table">
      <tr>
        <td class="box_top_left_grid"></td>
        <td class="box_top_center_grid">
         <!-- 导航 -->
        <div class="box_top_center_grid_text"> 当前位置：<a href="#">首页</a> >> 系统管理 >> 权限列表</div>
        <!-- 导航 -->
        </td>
        <td class="box_top_right_grid"></td>
      </tr>
      <tr>
        <td class="box_left"></td>
        <td>

        <!-- 内嵌按钮-->
        <table class="layout_grid_function">
            <form action="${pageContext.request.contextPath}/admin/toSetPermissionPage.do" method="post" id="queryForm" name="queryForm" ><tr><td>
         权限名：<input type="text" name="name" id="name"  class="form_query" value="<%=name %>" />
          <input type="hidden" name="userid" id="userid" value="<%=userid %>"/>
           <input type="submit" class="button_original_yellow"  value="查询"/>

          </td>
         

          </tr>
          </form>
          </table>
          <!-- 内嵌按钮-->
          <form name="frmList" action="${pageContext.request.contextPath}/admin/setPermission.do" method="post" id="delForm">
              <input type="hidden" name="method" id="method"/>              
      		<input type="hidden" name="userid" value="<%=userid %>"/>
      		<input type="hidden" name="page" value="<%=currPage %>"/>
      		<input type="hidden" name="name" value="<%=name %>"/>
      	<input type="button" class="button_original"  value="分配权限" id="given"/>
         <!--内嵌内容表格-->
         <table   border="0" cellspacing="0" cellpadding="0" class="box_table">
      <tr>
        <td class="box_top_left_content"></td>
        <td class="box_top_center_content tac">权限列表</td>
        <td class="box_top_right_content"></td>
      </tr>
      <tr>
        <td class="box_left_content"></td>
        <td class="tdPadding">
<!--内容-->
		<table width="100%" border="0" cellspacing="1" cellpadding="1" class="grid_table">
		<tr class="grid_table_head">
                    <td><input type="checkbox" name="checkall" id="checkall" />&nbsp;</td>

  <td>序号</td>
    <td>权限名</td>
  </tr>
 <% for(int i=0;i<permissionList.size();i++){
		Map m=(Map)permissionList.get(i);
		
	%>
  <tr>
      <td align="center"><input type="checkbox" id="id" name="id" value="<%=m.get("id").toString() %>" <%if(pidList!=null && pidList.contains(m.get("id").toString()))out.println("checked='checked'"); %>/>&nbsp;</td>
      <td><%=m.get("id").toString() %>&nbsp;</td>
    <td><%=m.get("name").toString() %>&nbsp;</td>
  </tr>
	<%} %>
</table>
<!--内容-->

        </td>
        <td class="box_right_content"></td>
      </tr>
      <tr>
        <td class="box_bottom_left_content"></td>
        <td class="box_bottom_center_content">

		<!--内嵌分页及工作流按钮-->
      <div class="layout_grid_page_workflow">

         <div class="layout_grid_page tac">
        <%=pageHtml %>
       
         </div>
      </div>
         <!--内嵌分页按钮-->

		</td>
        <td class="box_bottom_right_content"></td>
      </tr>
    </table>
      </form>



        </td>
        <td class="box_right"></td>
      </tr>
      <tr>
        <td class="box_bottom_left"></td>
        <td class="box_bottom_center"></td>
        <td class="box_bottom_right"></td>
      </tr>
    </table>
    <!-- end #box_table -->


    <!-- end #layout_mainContent -->
</div>
</div>

</body>
</html>
<script>

    function toSp()
    {
        frmList.act.value="sp";
        frmList.submit();
    }
     function toStar()
    {
        frmList.act.value="star";
        frmList.submit();
    }
     
    </script>